<template lang="pug">
.handsontable
</template>

<script>
import Handsontable from 'handsontable/dist/handsontable.full.js'
import 'handsontable/dist/handsontable.full.css'

export default {
  name: 'handsontable',
  props: ['settings', 'fn'],
  data () {
    return {
      table: null,
    }
  },
  ready () {
    this.table = new Handsontable(this.$el, this.settings)
    this.fn(this.table)
  },
  beforeDestroy () {
    this.table.destroy()
  },
}
</script>

<style lang="sass" scoped>
</style>
